home *** CD-ROM | disk | FTP | other *** search
- -- card: 6370 from stack: in
- -- bmap block id: 7680
- -- flags: 0000
- -- background id: 6414
- -- name: Speak and Spell
- ----- HyperTalk script -----
- --- "Speak and Spell" card
- --- Globals:
- --- SaS_wordlist list of words
- --- SaS_numberofwords number of words left
- --- SaS_wordnumber number of selected word
- --- SaS_currentword current word
- --- SaS_currentphonemes phonemes of current word
-
- on openCard
- global SaS_numberofwords, SaS_wordlist
- set lockScreen to true
- --- get list of words
- put card field "word list" of card "Word List" into SaS_wordlist
- put number of lines in SaS_wordlist into SaS_numberofwords
- put empty into card field "userinput"
- send setSlider to bg button "Slider"
- --- this is a bug...
- --- choose lasso tool
- --- doMenu "Select"
- --- doMenu "Opaque"
- --- choose browse tool
- set lockscreen to false
- speak "Welcome to Speak and Spell"
- speak "Enter your answers by typing."
- wait 20
- ControlLock "on"
- send mouseUp to card button "Next"
- end openCard
-
- on closeCard
- global SaS_wordlist, SaS_currentword, SaS_currentphonemes, SaS_wordnumber
- controlLock "Off"
- -- clear globals - should enable garbage collection to relcaim store
- put empty into SaS_wordlist
- put empty into SaS_currentword
- put empty into SaS_currentphonemes
- put empty into SaS_wordnumber
- end closeCard
-
- on checkAnswer
- global SaS_currentword, SaS_numberofwords, SaS_wordnumber, SaS_currentphonemes, SaS_wordlist
- if card field userinput = SaS_currentword then
- put SaS_currentphonemes into it
- delete last char of it
- speak phonemes,"YUW SPEH1LT " & it & "KOHRREH1KTLIY. #"
- delete line SaS_wordnumber of SaS_wordlist
- subtract 1 from SaS_numberofwords
- if SaS_numberofwords = 0 then
- speak "You have spelt correctly all the words which I know!"
- speak "Goodbye."
- go to card "Introduction"
- else
- send mouseUp to card button "Next"
- end if
- else
- speak phonemes,SaS_currentphonemes
- speak "is not spelt that way. Either try again or press next to skip."
- put "" into card field userinput
- end if
- end checkAnswer
-
- on controlKey num
- if (num >= 97 and num <= 122) or num = 8 or num = 13 or num = 3 then
- click at loc of bg button ("K" & num)
- else if num >= 65 and num <= 90 then
- click at loc of bg button ("K" & (num + 32))
- else if num = 28 then arrowKey left
- else if num = 29 then arrowKey right
- end controlKey
-
-
-
- -- part 4 (button)
- -- low flags: 00
- -- high flags: 8001
- -- rect: left=432 top=25 right=79 bottom=504
- -- title width / last selected line: 0
- -- icon id / first selected line: 1005 / 1005
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Edit dictionary
- ----- HyperTalk script -----
- on mouseUp
- visual effect iris open
- go to next card
- end mouseUp
-
-
-
- -- part 5 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=4 top=84 right=115 bottom=37
- -- title width / last selected line: 0
- -- icon id / first selected line: 30557 / 30557
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name:
- ----- HyperTalk script -----
- on mouseUp
- visual effect dissolve
- go to card "Introduction"
- end mouseUp
-
-
-
- -- part 6 (button)
- -- low flags: 00
- -- high flags: 0000
- -- rect: left=4 top=26 right=57 bottom=37
- -- title width / last selected line: 0
- -- icon id / first selected line: 1011 / 1011
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name:
- ----- HyperTalk script -----
- on mouseUp
- go home
- end mouseUp
-
-
-
- -- part 7 (button)
- -- low flags: 00
- -- high flags: A003
- -- rect: left=309 top=109 right=131 bottom=453
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Am I right? (Return)
- ----- HyperTalk script -----
- on mouseUp
- controlKey 13
- end mouseUp
-
-
-
- -- part 8 (button)
- -- low flags: 00
- -- high flags: A003
- -- rect: left=220 top=81 right=103 bottom=453
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Erase last letter (Backspace)
- ----- HyperTalk script -----
- on mouseUp
- controlKey 8
- end mouseUp
-
-
-
- -- part 9 (button)
- -- low flags: 00
- -- high flags: A003
- -- rect: left=52 top=80 right=102 bottom=195
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Erase all letters
- ----- HyperTalk script -----
- on mouseUp
- put "" into card field userinput
- end mouseUp
-
-
-
- -- part 10 (button)
- -- low flags: 00
- -- high flags: A003
- -- rect: left=53 top=108 right=131 bottom=195
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Say it again please
- ----- HyperTalk script -----
- on mouseUp
- global SaS_currentphonemes
- speak phonemes,SaS_currentphonemes
- end mouseUp
-
-
-
- -- part 11 (button)
- -- low flags: 00
- -- high flags: A003
- -- rect: left=52 top=137 right=159 bottom=454
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Next
- ----- HyperTalk script -----
- on mouseUp
- global SaS_currentword, SaS_numberofwords, SaS_wordnumber, SaS_currentphonemes, SaS_wordlist
- put "" into card field userinput
- put random(SaS_numberofwords) into SaS_wordnumber
- put item 1 of line SaS_wordnumber of SaS_wordlist into SaS_currentword
- put item 2 of line SaS_wordnumber of SaS_wordlist into SaS_currentphonemes
- speak "How do you spell"
- speak phonemes,SaS_currentphonemes
- end mouseUp
-
-
-
- -- part 13 (field)
- -- low flags: 01
- -- high flags: 0002
- -- rect: left=91 top=185 right=215 bottom=413
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 18
- -- style flags: 256
- -- line height: 24
- -- part name: userinput
- ----- HyperTalk script -----
- on returnKey
- click at loc of card button "Am I right?"
- end returnKey
-
-
- -- part 14 (field)
- -- low flags: 01
- -- high flags: 0004
- -- rect: left=176 top=27 right=55 bottom=350
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 3
- -- text size: 18
- -- style flags: 256
- -- line height: 24
- -- part name:
-
-
- -- part contents for card part 14
- ----- text -----
- Speak and Spell